<?php
/**
 * Created by PhpStorm.
 * User: 17732
 * Date: 2018/6/20
 * Time: 17:03
 */

namespace app\admin\model;


use think\Db;
use think\Model;

class Horn extends Model
{
    /**
     * 添加一条滚屏
     */
    public static function addHorn($arrHorn = array()){
        if(empty($arrHorn) || !is_array($arrHorn)) return;
        $addhorn = Db::name('horn')->insert($arrHorn);
        return $addhorn;
    }
    /**
     * 添加多条滚屏
     */
    public static function addManyHorns($arrHorn = array()){
        if(empty($arrHorn) || !is_array($arrHorn)) return;
        $addhorns = Db::name('horn')->insertAll($arrHorn);
        return $addhorns;
    }
    /**
     * 查询所有滚屏
     */
    public static function selectAllHorn(){
        $query = Db::name('horn')->order('id','desc')->select();
        return $query;
    }
    /**
     * 编辑horn
     */
    public static function editHorn($arrHorn){
        if(empty($arrHorn) || !is_array($arrHorn)) return;
        $editHorn = Db::name('horn')->update($arrHorn);
        return $editHorn;
    }
}